package com.d2.modules.system.dept.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.d2.common.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author mayihua
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_dept")
public class Dept extends BaseEntity {
    /** 父部门ID */
    private Long pid;

    @TableField(exist = false)
    private List<Dept> children;

    /** 祖级列表 */
    private String ancestors;

//    public String getAncestors(){
//        if(ancestors == null){
//            return "";
//        }
//        return ancestors;
//    }

    /** 部门名称 */
    private String name;

    private Integer sort;
    private String code;
}
